﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class mesas_elegirMesa : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Usuario user = (Usuario)this.Session["Usuario"];
        if (user == null)
        {
            Response.Redirect("noEstaLogeado.aspx", true);
        }
        String texto = "<table border='1'><tr><td>IdMesa</td><td>Juego</td><td>Sitios libres</td></tr>";

        String idJuego = Request.QueryString["IdJuego"];
        ArrayList lista = GestionMesas.getInstance().getMesas(idJuego);
        foreach (MesaBeans m in lista)
        {
            texto += "<tr><td><a href='../Juegos/juego.aspx?idMesa="+m.getIdMesa()+"'>" + m.getIdMesa() + "</a></td><td>" + m.getNombreJuego() + "</td><td>" + m.sitiosLibres() + "</td></tr>";
        }
        texto += "</table>";
        Label1.Text = texto;
    }
    protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {

    }
}
